#include <Kharlia/Engine/Common.h>
#include <Kharlia/Engine/Init.h>
#include <Kharlia/Engine/TileData.h>

namespace kharlia { namespace engine {

void _InitTileDataBindings() {
    class_<FTileData, shared_ptr<FTileData>>("FTileData", init<>())
        .def(init<FSizeI const&>())
        .def(init<FSizeI const&, object>())
        .def(init<FSizeI const&, str>())
        .add_property("Size", make_function(&FTileData::GetSize, return_internal_reference<>()))
        .def("SetTiles", (void (FTileData::*)(tile_t))&FTileData::SetTiles)
        .def("SetTiles", (void (FTileData::*)(FVector2I const&, FSizeI const&, object))&FTileData::SetTiles)
        .def("SetTiles", (void (FTileData::*)(FVector2I const&, FSizeI const&, str))&FTileData::SetTiles)
        .def("SetTilesFast", &FTileData::SetTilesFast)
        .def("CopyTiles", (void (FTileData::*)(FVector2I const&, shared_ptr<FTileData>))&FTileData::CopyTiles)
        .def("CopyTiles", (void (FTileData::*)(FVector2I const&, FRectI const&, shared_ptr<FTileData>))&FTileData::CopyTiles)
        .def("ToList", &FTileData::ToList)
        .def("ToString", &FTileData::ToString)
        .def("__repr__", &FTileData::Repr)
        .def("__len__", &FTileData::GetTileCount)
        .def("__getitem__", &FTileData::GetTile)
        .def("__setitem__", &FTileData::SetTile)
        .def_pickle(PSFTileData())
        ;
}

}}